<?php 
global $loop,$post;
$sale_off = get_post_meta($post->ID,"gia-khuyen-mai",true);
$price = (get_post_meta($post->ID,"gia-ban",true)!="")?number_format(get_post_meta($post->ID,"gia-ban",true),0,",",".")." VNĐ":"Liên hệ";
?>
<div class="fourcol-one<?php echo ($loop%4==3)?" last":"";?>">
 
    <div class="product-image">
        <a href="<?php the_permalink()?>">
            <?php the_post_thumbnail("thumbnail","class=image-jcenter");?>
        </a>
		
		<?php if($sale_off!=""){ ?>
		<div class="sale-off"></div>
		<?php } ?>
    </div>
    
    <div class="product-meta">
        <h6 class="ptitle"><a href="<?php the_permalink();?>"><?php the_title()?></a></h6>
        <p class="prices">
            <?php if($sale_off!=""){ ?>
            <span></span><del><?php echo $price;?></del><br />
            <span class="price">Giá: </span> <ins><?php echo number_format($sale_off,0,",",".")?> VNĐ</ins>
            <?php }else{ ?>
            <span></span><del></del><br />
            <span class="price">Giá: </span> <ins><?php echo $price;?></ins>
            <?php } ?>
        </p>
    </div>
</div>